{template header}

<a href="?c=admin&a=GroupWeek" target="_self"><i class="icon-eye-open"></i>按周统计</a> &nbsp;&nbsp;
<a href="?c=admin&a=GroupMonth" target="_self"><i class="icon-eye-open"></i>按月统计</a> &nbsp;&nbsp;

<h4 style="padding-left:10px;" class="mt-20">
    <span>搜索</span>
    <i class="icon-search"></i>
</h4>
<form class="form-horizontal" method="post">


    <label>每周的数据(20150413-20150419)</label>
    <div class="control-group search-group" style="margin-left:-20px;">
        <label class="control-label" >开始日期:</label>
        <div class="controls">
          <input type="text" placeholder="开始日期" name="startWeek" value="{$searchWeek['startWeek']}">
        </div>
    </div>
    <div class="control-group search-group"style="margin-left:-10px;">
        <label class="control-label" >结束日期:</label>
        <div class="controls">
          <input type="text" placeholder="结束日期" name="endWeek" value="{$searchWeek['endWeek']}">
        </div>
    </div>

    <div class="control-group search-group"style="margin-left:-10px;">
        <label class="control-label">字段：</label>
        <div class="controls">
            <select name="field">
                <option {if $searchWeek['field'] == 'mileage'}selected="selected"{/if} value="mileage">里程</option>
                <option {if $searchWeek['field'] == 'num'}selected="selected"{/if} value="num">记录</option>
            </select>
        </div>
    </div>

    <div class="control-group search-group"style="margin-left:-10px;">
        <label class="control-label">排序：</label>
        <div class="controls">
            <select name="sort">
                <option {if $searchWeek['sort'] == 'asc'}selected="selected"{/if} value="asc">升序</option>
                <option {if $searchWeek['sort'] == 'desc'}selected="selected"{/if} value="desc">降序</option>
            </select>
        </div>
    </div>


    <div class="control-group search-group">
        <div class="controls">
            <input type="hidden" value="search" name="s">
            <button class="btn" type="submit">提交</button>
            <!-- <button class="btn" type="reset">重置</button> -->
        </div>
    </div>
</form>



<div class="bs-docs-example pt-15" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>群组ID</th>
                <th>群组名称</th>
                <th>里程
                </th>
                <th>记录数
                </th>
            </tr>
        </thead>
        <tbody>
            {if !$list}  
                <tr>
                    <td>暂无记录</td>
                    <td></td>     
                    <td></td>    
                    <td></td>
                    <td></td>     
                    <td></td>    
                </tr>
            {else}

            {loop $list $k $v}
            <tr id="{$v['id']}">
                <td><a href="?c=admin&a=GroupStatistic&gid={$v['gid']}">{$v['gid']}</a></td>
                <td>{$v['name']}</td>
                <td>{$v['total_mileage']}</td>
                <td>{$v['total_num']}</td>
            </tr>
            {/loop}

            {/if}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
{template footer}
